package com.qf.dao.sys.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qf.api.sys.entity.SysRoleEntity;
import com.qf.api.sys.vo.OptionsVO;
import com.qf.api.sys.vo.RolePageVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
* @author sin
* @description 针对表【sys_role(角色表)】的数据库操作Mapper
* @createDate 2024-10-12 16:52:40
*/
@Mapper
public interface SysRoleMapper extends BaseMapper<SysRoleEntity> {

    List<SysRoleEntity> getSelectedRolesByMenuId(@Param(value = "menuId")Long menuId);

    List<OptionsVO> getRoleOption();

    List<RolePageVO> getRolePage(@Param(value = "name") String name, @Param(value = "status") Integer status, @Param(value = "code") String code);

    List<Long> getMenuByRoleId(Long roleId);

    @Update("UPDATE sys_role SET name = #{name},code= #{code},remark = #{remark} WHERE id = #{id}")
    int updateRoleById(@Param(value = "id") Long id, @Param(value = "name") String name, @Param(value = "code") String code, @Param(value = "remark") String remark);
}




